Method of compressing a block-based binary image

ABSTRACT

A method of compressing a 2×2 block based binary image is provided. The method includes: determining whether pixels included in a block are included in existing patterns; generating the number N of the pixels included in the existing patterns (N is a natural number); when N is more than a predetermined value, compressing the block with a binary bit stream comprising information about patterns of the pixels included in the existing patterns and color information about the pixels having a new pattern. The method of compressing a 2×2 block based binary image reduces information damage which may occur during compression and restoration of the binary pattern so that the difference in picture quality between an original image and the restored image can be visibly improved.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of Korean Patent Application No.10-2008-0024892, filed on Mar. 18, 2008, in the Korean IntellectualProperty Office, the contents of which are herein incorporated byreference in their entirety.

BACKGROUND

1. Field of the Invention

Example embodiments of the present invention relate to imagecompression. More particularly, example embodiments of the presentinvention relate to a method of compressing a 2×2 block based binaryimage including compressing pixels included in an existing pattern withminimum information and adding color information for pixels having anon-uniform pattern to a bit-stream so as to efficiently preventdegradation of image quality, when the pixels having a repeating patternand pixels having a non-uniform pattern exist in one block.

2. Description of the Related Art

In a conventional 2×2 block based binary image compression algorithm,image data is compressed using the difference between values ofneighboring pixels. Such a 2×2 block based binary image compressionalgorithm is commonly referred to as Differential Pulse Code Modulation(DPCM).

However, in DPCM, when pixels included in an existing pattern and pixelsincluded in a new pattern exist in one block, information may be damagedduring the compression and restoration of an image for all the pixelspresent in a corresponding block. Such information damage may affect ablock which is subsequently compressed.

Thus, when the conventional binary image compression is used, seriousvisible degradation is generated in blocks having a number ofnon-uniform patterns and in their neighboring blocks.

SUMMARY

Example embodiments provide a method of compressing a 2×2 block basedbinary image capable of minimizing degradation of image quality andperforming efficient compression.

According to one aspect, there is provided a method of compressing abinary image. The method includes: determining whether pixels includedin a block are included in existing patterns; generating a number N ofpixels of the block that are included in the existing patterns (where Nis a natural number); and when N is more than a predetermined value,compressing the block to a binary bit stream, the bit stream comprisinginformation of patterns of the pixels included in the existing patternsand color information of the pixels having a new pattern.

In one embodiment, the binary bit stream further includes modeinformation indicating whether the binary bit stream includes compressedbinary image information. In one embodiment, the binary bit streamfurther includes sub-mode information indicating whether the existingpattern is used. In one embodiment, the binary bit stream furtherincludes pattern information indicating whether first through N^(th)pixels are included in the existing pattern, wherein the pixels includedin the block are sequentially denoted as first through M^(th) pixels andwherein M is a natural number higher than N. In one embodiment, thebinary bit stream further includes information about N. In oneembodiment, the binary bit stream further includes pixel pattern-typeinformation indicating in which pattern of the existing patterns the Npixels are included.

In one embodiment, the method further includes, when the pixels areincluded in the existing patterns, determining in which pattern of theexisting patterns the pixels are included. In another embodiment, thebinary bit stream includes pixel-type information indicating in whichpattern of the existing patterns the pixels are included.

In one embodiment, the color information includes R, G, and B values ofthe corresponding pixel. In another embodiment, in the colorinformation, some of the upper bits of the R, G, and B values of thecorresponding pixel are stored according to a compression rate. In oneembodiment, when the block includes two or more pixels having a newpattern, the color information is an average value of the pixels havingthe new pattern.

In one embodiment, the binary bit stream includes mode informationindicating whether the binary bit stream includes compressed binaryimage information, sub-mode information indicating whether an existingpattern is used, pattern information indicating whether first throughN^(th) pixels are included in the existing patterns, wherein the pixelsincluded in the block are sequentially denoted as first through M^(th)pixels, information about N, pixel pattern-type information indicatingin which pattern of the existing patterns the N pixels are included, andcolor information for the pixels having the new pattern.

In one embodiment, the method further includes, when N is below thepredetermined value, compressing data of the block using DifferentialPulse Code Modulation (DCPM).

In one embodiment, the block is a 2×2 block. In one embodiment, thepredetermined value is 2.

According to another aspect, a method of compressing a 2×2 block basedbinary image includes determining whether pixels included in a block areincluded in at least one of a defined pattern A or a defined pattern B,generating a number N of pixels of the block that are included in atleast one of the pattern A and the pattern B, and, when N is more than apredetermined value, compressing the block to a binary bit stream, thebit stream including information of patterns of the pixels included inat least one of the pattern A and the pattern B and color information ofthe pixels having a new pattern.

In one embodiment, the binary bit stream includes mode informationindicating whether the binary bit stream includes compressed binaryimage information, sub-mode information indicating whether at least oneof the pattern A and the pattern B is used, pattern informationindicating whether first through third pixels are included in at leastone of the pattern A and the pattern B, information about N, pixelpattern-type information indicating in which pattern from among thepattern A and the pattern B the N pixels are included, and colorinformation for the pixels having the new pattern.

In one embodiment, the predetermined value is 2 and, when N is 3, thecolor information includes R, G, and B values of the correspondingpixel.

In one embodiment, when N is 2, the color information is an averagevalue of two pixels having the new pattern.

In one embodiment, when N is below 2, the method further includescompressing data of the block using Differential Pulse Code Modulation(DCPM).

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing and other objects, features and advantages of theinvention will be apparent from the more particular description ofpreferred aspects of the invention, as illustrated in the accompanyingdrawings in which like reference characters refer to the same partsthroughout the different views. The drawings are not necessarily toscale, emphasis instead being placed upon illustrating the principles ofthe invention.

FIG. 1 is a flowchart illustrating a method of compressing a binaryimage according to an embodiment of the invention.

FIG. 2 illustrates image data compressed using the method of compressinga binary image of FIG. 1.

FIG. 3 illustrates a binary bit stream according to the method ofcompressing a binary image of FIG. 1, when N of FIG. 1 is “3”.

FIG. 4 illustrates a binary bit stream according to the method ofcompressing a binary image of FIG. 1, when N of FIG. 1 is “2”.

DETAILED DESCRIPTION OF THE EMBODIMENTS

Hereinafter, example embodiments are described more fully with referenceto the accompanying drawings, in which exemplary embodiments of theinvention are illustrated.

In the drawings, like reference numerals denote like elements.

FIG. 1 is a flowchart illustrating a method of compressing a binaryimage according to an embodiment. The method of compressing a binaryimage according to the embodiment of FIG. 1 is, in particular, a methodof compressing a 2×2 block based binary image, as illustrated in FIG. 2,in which image data is formed of 2×2 blocks and the blocks arecompressed.

Hereinafter, for the purposes of illustration, blocks described for themethod of compressing a binary image include four pixels, as illustratedin FIG. 2; however, the invention is not limited thereto. Also, the fourpixels included in each block are respectively denoted as first pixelP1, second pixel P2, third pixel P3, and fourth pixel P4, as illustratedin FIG. 2. Although FIG. 2 only illustrates pixels P1-P3 of an x^(th)block BLKx (where x is a natural number), an i^(th) block BLKi (where iis a natural number) and a j^(th) block BLKj (where j is a naturalnumber) may each include pixels denoted as first pixel P1, second pixelP2, third pixel P3, and fourth pixel P4.

In addition, in this illustration, it is assumed that each pixel has adefined existing pattern A or pattern B, or new patterns. The pattern Aor the pattern B is denoted as a defined existing pattern in the methodof compressing a binary image based on a 2×2 block.

Referring to FIGS. 1 and 2, the method 100 of compressing a binary imageincludes receiving pixels included in an arbitrary block in operationS10. A determination is then made as to whether the received pixels areincluded in existing patterns in operation S120.

When the received pixels are included in existing patterns (“Yes” inoperation S120), information indicating which pattern in the existingpatterns includes the received pixels is stored in operation S130. Thatis, information indicating whether the received pixels are included inthe pattern A or the pattern B is stored. On the other hand, when thereceived pixels are not included in existing patterns (“No” in operationS120), information about the received pixels is stored in operationS140. Here, information about the received pixels may be colorinformation of the pixels, that is, an RGB value of the received pixels.

The above-described operations are performed on all pixels included inthe corresponding blocks in operations S150 and S160. If at step S150the pixel is not determined to be the last pixel (“No” in operationS150), then the process increments a counter to K=K+1, in operationS160, and returns to the first operation S110 of receiving a K^(th)pixel. When a determination has been completed for all pixels includedin one block (“Yes” in operation S150), the method 100 of compressing abinary image is used to generate the number N of the pixels (where N isa natural number) of the corresponding block that match the existingpattern, such as pattern A or pattern B, according to operation S170.

In FIG. 2, all pixels P1 through P4 of the x^(th) block BLKx areincluded in the existing patterns. That is, the first pixel P1 and thefourth pixel P4 are included in the pattern A. The second pixel P2 andthe third pixel P3 are included in the pattern B. Therefore, N for thex^(th) block BLKx is determined at step S170 of FIG. 1 to be “4.”

In FIG. 2, in the i^(th) block BLKi, the first pixel P1 is included inthe pattern A and the second and third pixels P2 and P3 are included inthe pattern B. The fourth pixel P4 has a new pattern, instead of theexisting pattern A or B. Thus, N for the i^(th) block BLKi is determinedat step S170 of FIG. 1 to be “3.”

In FIG. 2, in the j^(th) block BLKj, the first pixel P1 is included inthe pattern A and the third pixel P3 is included in the pattern B. Onthe other hand, the second and fourth pixels P2 and P4 have newpatterns, instead of the existing patterns A or B. Thus, N for thej^(th) block BLKj is determined at step S170 of FIG. 1 to be “2.” Also,the second and fourth pixels P2 and P4 of the j^(th) block BLKj may eachhave a different pattern.

Then, whether N is more than a predetermined value is determined inoperation S180. In particular, in the method 100 of compressing a binaryimage of FIG. 1, the predetermined value is set as “2.” Thepredetermined value may be set as a value other than “2” according tothe performance of the system, or other desired system parameters.

When it is determined at operation S 180 that three or more pixelshaving new patterns exist in one block (N=“0” and “1”), the conventionalmethod of compressing a binary image such as Differential Pulse CodeModulation (DPCM) may be efficient, as in operation 300 of FIG. 1. Thus,if N is below the predetermined value, the binary image is compressedusing DPCM in operation 300 of FIG. 1.

In FIGS. 1 and 2, when N is more than the predetermined value, in thisexample “2”, in operation S190, the block is compressed to a binary bitstream having a data structure which is hereinafter described.

Hereinafter, the binary bit stream structures for cases in which Nexceeds the predetermined value, i.e., N is “2” and N is “3,” arerespectively described. As described above, when N is “2,” the pixelshaving the pattern as in the j^(th) block BLKj of FIG. 2 may beincluded. When N is “3,” the pixels having the patterns as in the i^(th)block BLKi of FIG. 2 may be included.

Firstly, a binary bit stream for a block is described when N is “3”,that is, the case of the i^(th) block BLKi of FIG. 2.

FIG. 3 illustrates a binary bit stream BSTi for the i^(th) block BLKi.

Referring to FIGS. 2 and 3, the binary bit stream BSTi includes modeinformation 1, sub-mode information 2, pattern information 3,information 4 about N, pixel pattern-type information 5, and colorinformation 6, 7, and 8. However, the configuration of the binary bitstream BSTi is not limited thereto and may include some of these typesof information, or other information.

Details, sizes and values of each type of information are hereinafterdescribed in more detail. However, each type of information is notlimited to the described details, sizes and values.

The mode information 1 is formed of four bits, as illustrated in FIG. 3.The mode information 1 indicates that the binary bit stream BSTiincludes compressed binary image information. Thus, the binary bitstream BSTi according to the method of compressing a binary image of anembodiment, as illustrated in FIG. 3, is set to have the binary value of“1111” for the mode information 1.

The sub-mode information 2 is formed of one bit, as illustrated in FIG.3. The sub-mode information indicates whether the binary bit stream BSTiuses the existing pattern (pattern A or pattern B). Thus, the binary bitstream BSTi according to the method of compressing a binary image of anembodiment, as illustrated in FIG. 3, is set to have the binary value of“0” for the sub-mode information 2.

The pattern information 3 is formed of three bits, as illustrated inFIG. 3. The pattern information 3 of FIG. 3 indicates whether the firstpixel P1 through the third pixel P3 of the corresponding block areincluded in the existing patterns A and B. The pixel having the existingpattern A or B is set to have the binary value of “1” and the pixelhaving a new pattern is set to have the binary value of “0.” In thei^(th) block BLKi, the first pixel P1 through the third pixel P3 of thei^(th) block BLKi are included in the existing pattern and thus, thebinary bit stream BSTi has the binary value of “111” for the patterninformation 3, as illustrated in FIG. 3. Alternatively, the pixel havingthe existing pattern A or B may be set to have the binary value of “0”and the pixel having a new pattern may be set to have the binary valueof “1.”

Although where N is “3,” when the first pixel P1, the third pixel P3,and the fourth pixel P4 have the existing pattern A or B, unlike thei^(th) block BLKi, the pattern information 3 has the binary value of“101.” That is, since the binary bit stream BSTi of FIG. 3 is the binarybit stream when only one pixel having a new pattern exists in one block,whether the fourth pixel P4 is included in the existing pattern, inaddition to the first through third pixels P1 through P3, is determinedfrom the pattern information 3.

Whether the binary bit stream BSTi of FIG. 3 corresponds to the binarybit stream when N is “3” is determined according to the information 4about N. The information 4 about N is formed of one or more bits and isformed of two bits in the binary bit stream BSTi of FIG. 3. When N is“3,” the information 4 about N, as illustrated in FIG. 3, has the binaryvalue of “11.”

Then, the binary bit stream BSTi of FIG. 3 includes the pixelpattern-type information 5 formed of three bits. The pixel pattern-typeinformation 5 indicates in which one of the pattern A and the pattern Bthe pixels are included. In FIG. 3, when the corresponding pixel isincluded in the pattern A, the binary value is “0” and, when thecorresponding pixel is included in the pattern B, the binary value is“1.” Thus, the binary bit stream BSTi of FIG. 3 for the i^(th) blockBLKi of FIG. 2 has the binary value of “011” for the pixel pattern-typeinformation 5. Alternatively, when the corresponding pixel is includedin the pattern A, the binary value may be “1” and, when thecorresponding pixel is included in the pattern B, the binary value maybe “0.”

The color information 6, 7, and 8 are respectively formed of eight bitswith respect to the R, G, and B values for the pixel having a newpattern (fourth pixel P4). However, the R, G, and B values may be storedin upper seven bits of the eight bits. In addition, the R, G, B valuesmay be stored in some of the upper bits according to the compressionrate.

Since the binary bit stream is generated, compression of one block BLKimay be performed. A method of compressing a block such as the j^(th)block BLKj is described hereinafter for an embodiment in which N is “2.”

FIG. 4 illustrates a binary bit stream BSTj for the j^(th) block BLKj.

Referring to FIGS. 2 and 4, the binary bit stream BSTj includes modeinformation 1, sub-mode information 2, pattern information 3,information 4 about N, pixel pattern type information 5, and colorinformation 6, 7, and 8, as in the binary bit stream BSTi of FIG. 3. Inaddition, details of each type of information are the same as those ofin FIG. 3. However, sizes and values of some of the information may bedifferent from those of the binary bit stream BSTi of FIG. 3. Thesedifferences are hereinafter described in more detail.

The mode information 1 and the sub-mode information 2 of the binary bitstream BSTj of FIG. 4 are the same as those of FIG. 3. In addition, thebinary bit stream BSTj of FIG. 4 may also include the patterninformation formed of three bits, as in FIG. 3. However, in the j^(th)block BLKj, the first pixel P1 and the third pixel P3 are included inthe existing pattern and the second pixel P2 is included in a newpattern so that, as illustrated in FIG. 4, the pattern information 3 hasthe binary value of “101.”

Since the binary bit stream BSTj of FIG. 4 is the binary bit stream forthe block when N is “2,” the information 4 about N has the binary valueof “10.” Also, unlike FIG. 3, only the first pixel P1 and the thirdpixel P3 of the j^(th) block BLKj are included in the existing pattern Aor B, and the pixel pattern-type information 5 of FIG. 4 is formed oftwo bits. Here, the first pixel P1 of the j^(th) block BLKj is includedin the pattern A and the third pixel P3 of the j^(th) block BLKj isincluded in the pattern B so that the pixel pattern-type information 5of FIG. 4 has the binary value of “01.”

The color information 6, 7, and 8 of the binary bit stream BSTj of FIG.4 are respectively formed of eight bits with respect to the R, G, and Bvalues for the pixel having a new pattern (fourth pixel P4), as in FIG.3. In addition, the R, G, and B values may be stored in upper seven bitsof the eight bits. However, the color information 6, 7, and 8 of thebinary bit stream BSTj of FIG. 4 may have average values of colorinformation of two pixels having a new pattern, that is, the averagevalue of each R, G, and B value of the second pixel P2 and the fourthpixel P4.

As described above, in the method of compressing a 2×2 block basedbinary image according to an embodiment, when an existing pattern and anew pattern are mixed in one block, the pixels included in the existingpattern are compressed with minimum information and the pixels havingnew patterns include color information so that degradation of picturequality can be efficiently prevented.

The method of compressing a 2×2 block based binary image reducesinformation damage which may occur during compression and restoration ofthe binary pattern so that the difference in picture quality between anoriginal image and the restored image can be visibly improved.

Therefore, the method of compressing a 2×2 block based binary image canbe applied to an image compression circuit, in which picture quality isimportant, such as a frame memory compression engine of a response speedcompensation circuit of a liquid crystal display (LCD) panel or acompression circuit for transmitting an image which requires a widebandwidth.

While aspects of the present invention have been particularly shown anddescribed with reference to differing embodiments thereof, it should beunderstood that these exemplary embodiments should be considered in adescriptive sense only and not for purposes of limitation. Thus,although a few embodiments have been shown and described, changes may bemade in these embodiments.

For example, although four pixels included in the existing pattern arenot illustrated, in view of the description of the i^(th) block of FIG.2 in which three pixels are included in the existing patterns a similarprocess can be applied to an embodiment in which four pixels areincluded in the existing patterns.

While the invention has been particularly shown and described withreference to exemplary embodiments thereof, it will be understood thatvarious changes in form and details may be made therein withoutdeparting from the spirit and scope of the following claims.

1. A method of compressing a binary image, the method comprising:determining whether pixels included in a block are included in existingpatterns; generating a number N of pixels of the block that are includedin the existing patterns, wherein N is a natural number; and when N ismore than a predetermined value, compressing the block to a binary bitstream, the bit stream comprising information of patterns of the pixelsincluded in the existing patterns and color information of the pixelshaving a new pattern.
 2. The method of claim 1, wherein the binary bitstream further comprises mode information indicating whether the binarybit stream includes compressed binary image information.
 3. The methodof claim 1, wherein the binary bit stream further comprises sub-modeinformation indicating whether the existing pattern is used.
 4. Themethod of claim 1, wherein the binary bit stream further comprisespattern information indicating whether first through N^(th) pixels areincluded in the existing patterns, wherein the pixels included in theblock are sequentially denoted as first through M^(th) pixels andwherein M is a natural number higher than N.
 5. The method of claim 1,wherein the binary bit stream further comprises information about N. 6.The method of claim 1, wherein the binary bit stream further comprisespixel pattern-type information indicating in which pattern of theexisting patterns the N pixels are included.
 7. The method of claim 1,further comprising, when the pixels are included in the existingpatterns, determining in which pattern of the existing patterns thepixels are included.
 8. The method of claim 7, wherein the binary bitstream comprises pixel type information indicating in which pattern ofthe existing patterns the pixels are included.
 9. The method of claim 1,wherein the color information comprises R, G, and B values of thecorresponding pixel.
 10. The method of claim 9, wherein in the colorinformation, some of upper bits of the R, G, and B values of thecorresponding pixel are stored according to a compression rate.
 11. Themethod of claim 1, wherein when the block comprises two or more pixelshaving a new pattern, the color information is an average value of thepixels having the new pattern.
 12. The method of claim 1, wherein thebinary bit stream comprises: mode information indicating whether thebinary bit stream includes compressed binary image information; sub-modeinformation indicating whether an existing pattern is used; patterninformation indicating whether first through N^(th) pixels are includedin the existing patterns, wherein the pixels included in the block aresequentially denoted as first through M^(th) pixels; information aboutN; pixel pattern type information indicating in which pattern of theexisting patterns the N pixels are included; and color information forthe pixels having the new pattern.
 13. The method of claim 1, furthercomprising, when N is below the predetermined value, compressing data ofthe block using Differential Pulse Code Modulation (DCPM).
 14. Themethod of claim 1, wherein the block is a 2×2 block.
 15. The method ofclaim 1, wherein the predetermined value is
 2. 16. A method ofcompressing a 2×2 block based binary image, the method comprising:determining whether pixels included in a block are included in at leastone of a defined pattern A and a defined pattern B; generating a numberN of pixels of the block that are included in at least one of thepattern A and the pattern B; and when N is more than a predeterminedvalue, compressing the block to a binary bit stream, the bit streamcomprising information of patterns of the pixels included in at leastone of the pattern A and the pattern B and color information of thepixels having a new pattern.
 17. The method of claim 16, wherein thebinary bit stream comprises: mode information indicating whether thebinary bit stream includes compressed binary image information; sub-modeinformation indicating whether at least one of the pattern A and thepattern B is used; pattern information indicating whether first throughthird pixels included in the block are included in at least one of thepattern A or the pattern B; information about N; pixel pattern typeinformation indicating in which pattern from among the pattern A and thepattern B the N pixels are included; and color information for thepixels having the new pattern.
 18. The method of claim 16, wherein thepredetermined value is 2, and, when N is 3, the color informationcomprises R, G, and B values of the corresponding pixel.
 19. The methodof claim 16, wherein, when N is 2, the color information is an averagevalue of two pixels having the new pattern.
 20. The method of claim 16,further comprising, when N is below 2, compressing data of the blockusing Differential Pulse Code Modulation (DCPM).